home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / blitzbasic / blitz-list200994.lha / blitz-list / text0210.txt < prev    next >
Encoding:
Text File  |  1994-09-20  |  1.3 KB  |  49 lines

  1. >Why not do a DIM LIST a.list(0)? Or whatever variable you're using for your list?
  2. WOW, it worked, I think Blitz must be the first Language I have used which
  3. allows you to redim so easily, in fact it was so simple I didn't even think
  4. about this solution. Mucho Thanks for suggesting it.
  5.  
  6. Second bit.
  7. >sample code follows.......
  8. >
  9. >;Main Loop
  10. >Repeat
  11. >
  12. >ev.l=WaitEvent
  13. >gh.l=GadgetHit
  14. >code.l=EventCode
  15. >
  16. >Select ev
  17. >
  18. >    Case $40    ; gadget up event - needed for list views and other gadgets
  19. >
  20. >        Select gh
  21. >
  22. >            Case 52:lv1=code    ;52 is listview gadget # and lv1 holds value
  23. >                                ;of selected item - you can go up and down
  24. >                                ;from there
  25. >
  26. >.......end of sample code
  27.  
  28. I don't think I was too clear in my description :-( I can read the Listview
  29. no problem but I then want to take that value and set the List array pointer
  30. to point to the entry selected. I am currently using something similar to
  31. the following:
  32.  
  33.    ok=firstitem(mylist())
  34.    while(lv1>0)
  35.       ok=nextitem(mylist())
  36.       lv1=lv1-1
  37.    wend
  38.  
  39. therefore at the end of the loop the List array will point at the Listview
  40. entry selected.... Great for small lists, But could take a while on a larger
  41. array. I was just wondering if there was a way to set the pointer directly.
  42.  
  43. many thanks for the assistance Joel, appreciate it.
  44.  
  45.  
  46. Graham K.  
  47.  
  48.  
  49.